[gd_scene load_steps=12 format=2]

[ext_resource path="res://entities/light_switch/light_switch.dae" type="PackedScene" id=1]

[sub_resource type="GDScript" id=1]

script/source = "
extends Spatial

export (NodePath) var light_1
var node_1
export (NodePath) var light_2
var node_2

func _ready():
	node_1 = get_node(light_1)
	node_2 = get_node(light_2)
"

[sub_resource type="SpatialMaterial" id=2]

render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 1 )
metallic = 0.0
metallic_specular = 1.0
metallic_texture_channel = 0
roughness = 0.2
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Metallic", "Roughness" ]

[sub_resource type="SpatialMaterial" id=3]

render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 1 )
metallic = 1.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.3
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Metallic", "Roughness" ]

[sub_resource type="Animation" id=7]

resource_name = "switch_1_off"
length = 0.01
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Cube.1:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, -9.99999 ) ]
}

[sub_resource type="Animation" id=8]

resource_name = "switch_1_on"
length = 0.01
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Cube.1:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 9.99999 ) ]
}

[sub_resource type="Animation" id=9]

resource_name = "switch_2_off"
length = 0.01
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Cube.2:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, -9.99999 ) ]
}

[sub_resource type="Animation" id=10]

resource_name = "switch_2_on"
length = 0.01
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Cube.2:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 9.99999 ) ]
}

[sub_resource type="GDScript" id=4]

script/source = "
extends StaticBody

var on = true

func interact(relate):
	if on:
		on = false
		get_parent().node_1.hide()
		get_node(\"../AnimationPlayer\").play(\"switch_1_off\")
	else:
		on = true
		get_parent().node_1.show()
		get_node(\"../AnimationPlayer\").play(\"switch_1_on\")"

[sub_resource type="BoxShape" id=5]

extents = Vector3( 0.105475, 1, 0.217155 )

[sub_resource type="GDScript" id=6]

script/source = "
extends StaticBody

var on = true

func interact(relate):
	if on:
		on = false
		get_parent().node_2.hide()
		get_node(\"../AnimationPlayer\").play(\"switch_2_off\")
	else:
		on = true
		get_parent().node_2.show()
		get_node(\"../AnimationPlayer\").play(\"switch_2_on\")
"

[node name="light_switch" instance=ExtResource( 1 )]

script = SubResource( 1 )
light_1 = null
light_2 = null

[node name="Cube.2" parent="." index="0"]

material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform" ]

[node name="Cube.1" parent="." index="1"]

material/0 = SubResource( 2 )
_sections_unfolded = [ "Geometry", "Transform" ]

[node name="Cylinder.1" parent="." index="2"]

material/0 = SubResource( 3 )
_sections_unfolded = [ "material" ]

[node name="Cylinder" parent="." index="3"]

material/0 = SubResource( 3 )
_sections_unfolded = [ "material" ]

[node name="Cube" parent="." index="4"]

material/0 = SubResource( 2 )

[node name="AnimationPlayer" parent="." index="5"]

anims/switch_1_off = SubResource( 7 )
anims/switch_1_on = SubResource( 8 )
anims/switch_2_off = SubResource( 9 )
anims/switch_2_on = SubResource( 10 )

[node name="light_1" type="StaticBody" parent="." index="6"]

input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
script = SubResource( 4 )

[node name="CollisionShape" type="CollisionShape" parent="light_1" index="0"]

transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0467436, 0, 0.253888 )
shape = SubResource( 5 )
disabled = false

[node name="light_2" type="StaticBody" parent="." index="7"]

transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.503989 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
script = SubResource( 6 )

[node name="CollisionShape" type="CollisionShape" parent="light_2" index="0"]

transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0467436, 0, 0.253888 )
shape = SubResource( 5 )
disabled = false


